﻿using Autofac;
using CQRSFramework.Common.Autofac;
using CQRSFramework.Common.Components;

namespace CQRSFramework.Common.Configurations
{
    public static class CommonConfigurationExtensions
    {

        public static CommonConfiguration UseAutofac(this CommonConfiguration configuration)
        {
            return UseAutofac(configuration, new ContainerBuilder());
        }

        public static CommonConfiguration UseAutofac(this CommonConfiguration configuration, ContainerBuilder container)
        {
            ObjectContainer.SetContainer(new AutofacObjectContainer(container));
            return configuration;
        }

    }
}
